/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.aptech.search;

import com.aptech.entity.News;
import com.aptech.session.NewsFacadeLocal;
import java.util.List;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Administrator
 */
@ManagedBean
@RequestScoped
public class SearchNewsBean {
    @EJB
    private NewsFacadeLocal newsFacade;
  
    private String field;

    public String getField() {
        return field;
    }

    public void setField(String field) {
        this.field = field;
    }

    public List<News> getListnews() {
        return listnews;
    }

    public void setListnews(List<News> listnews) {
        this.listnews = listnews;
    }

    public Object getValue() {
        return value;
    }

    public void setValue(Object value) {
        this.value = value;
    }
    private Object value;
    private List<News> listnews;
    /** Creates a new instance of SearchNewsBean */
    public SearchNewsBean() {
    }
    
    public String searchnews(){    
        listnews=newsFacade.SearchNews(field, field);
        return "SearchNews";
    }
}
